<?php

function UserLoginBar() {
  if( $_SESSION['uid'] < 1 ) {
    echo '<form action="./user.php" method="post" >
            <input type="hidden" name="type" value="LOGIN" />
            name: <input type="text" name="user" value="user name" /> 
            pass: <input type="password" name="pass" value="password" />
            <input type="submit" value="login" />
          </form>
          <a href="./register.php">register?</a>';
  } else {
    echo "Welcome {$_SESSION['user']['name']}! Have fun!",
         '<a href="./user.php?type=LOGOUT">bye-bye?</a>';
  }
}

?>
